<script src="<?php echo $baseurl?>public/theme/analytics/datetimepicker/jquery.datetimepicker.js" type="text/javascript" ></script>
<link href="<?php echo $baseurl?>public/theme/analytics/datetimepicker/jquery.datetimepicker.css" type="text/css" rel="stylesheet" /> 

<div class="inside">
  <aside class="navigationPanel">
     
     <div class="tree pagesLinks">
        <ul>
           <ul>
              <li> <a href="#" class="active"><i class="fa fa-star"></i> Chi tiết chiến dịch</a> </li>
              <li> <a href="<?php echo $baseurl.'campaign/dia-diem.html'?>"><i class="fa fa-star"></i> Địa điểm</a> </li>
			  <li> <a href="<?php echo $baseurl.'campaign/tat-ca.html'?>"><i class="fa fa-star"></i> Tất cả chiến dịch</a> </li>
              <li> <a href="<?php echo $baseurl.'campaign/cho-duyet.html'?>" ><i class="fa fa-star"></i> Chiến dịch chờ duyệt</a> </li>
              <li> <a href="<?php echo $baseurl.'campaign/dang-chay.html'?>"><i class="fa fa-star"></i> Chiến dịch đang chạy</a> </li>
			  <li> <a href="<?php echo $baseurl.'campaign/dang-tam-dung.html'?>"><i class="fa fa-star"></i> Chiến dịch đang tạm dừng</a> </li>
			  <li> <a href="<?php echo $baseurl.'campaign/da-huy.html'?>"><i class="fa fa-star"></i> Chiến dịch đã hủy</a> </li>
           </ul>
        </ul>
     </div>
  </aside>
  <div class="contentPanel" style="height: 100%;">
     <div class="pages" id="profile">
        <div class="profile-edit-form">
        <?php if(validation_errors()):?>
            <h4>
                <p><?php echo validation_errors(); ?></p>
            </h4>
            <?php endif;?>
         <?php $att = array('id' => '', 'class' => '');echo form_open('', $att);?>
              <div class="contentBox switcher" style="height: 100%;">
                 <h3>Chi tiết chiến dịch</h3>
                    <div class="insideContentBox">
                          <div class="campaignDetail">
								<label>Danh sách địa điểm:</label> 
                               <table class="tableEsc" style="margin-bottom: 10px;width: 100%;">
                                    <tbody>
                                       <?php foreach( $dataListShop AS $el => $le):?>
                                           <?php foreach ( $data['place'] AS  $el1 => $le1 ){
												if ( $le1->id_place == $le->id ){ ?>
											   <tr>
                                                  <td><?php echo $le->shopName.'&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;Địa chỉ: '.$le->address;?></td>
												  <?php if($data['data']->active == 2):?>
                                                  <td style="text-align: center"><a class="click-link" href="<?php echo site_url('statistic-user')?>?p_id=<?php echo base64_encode($this->encrypt->encode($le1->id_place, 'statistic')).'&c_id='.base64_encode($this->encrypt->encode($data['data']->id, 'statistic'))?>">Thống kê</a></td>
                                                  <?php else:?>
                                                  <td style="text-align: center">Chưa có thống kê</td>
                                                  <?php endif;?>
											   </tr>
										   <?php }} ?>
                                       <?php endforeach;?>
                                    </tbody>
                               </table>
							     	
                               
<label for="frm-frm-title">Tên chiến dịch*:</label> 
<input type="text" name="title" value="<?php echo $data['data']->title;?>" class="ipt" autocomplete="off" id="frm-frm-title" placeholder="Tên chiến dịch..."/>

<label for="frm-time-start">Thời gian bắt đầu*:</label> 
<input type="text" name="time_start" value="<?php echo $data['data']->time_start;?>" class="ipt" autocomplete="off" id="frm-time-start" placeholder="Thời gian bắt đầu..."/>

<label for="frm-time-end">Thời gian kết thúc*:</label> 
<input type="text" name="time_end" value="<?php echo $data['data']->time_end;?>" class="ipt" autocomplete="off" id="frm-time-end" placeholder="Thời gian kết thúc..."/>

<label>Khách hàng:</label> 
<div class="lineHoller c">
<span><?php echo $data['data']->fullname;?></span>
</div>
<label>Nội dung yêu cầu:</label> 
<div class="lineHoller c">
<span><?php echo $data['data']->note;?></span>
</div>
<label>Trạng thái:</label> 
<div class="lineHoller c">
<span><?php echo $fview->status_campaign($data['data']->active);?></span>
</div>
<label for="frm-address">Kiểu hiển thị:</label> 
<div class="custom-line">
    <span class="select-custom">
        <select name="oneview" id="">
			<option value="1" <?php if($data['data']->oneview == 1){ echo 'selected="selected"'; }?> >Hiển thị 1 lần</option>
            <option value="0" <?php if($data['data']->oneview == 0){ echo 'selected="selected"'; }?>>Hiển thị nhiều lần</option>
          	
        </select>
        <a class="select-text">Chưa gửi duyệt</a>
    </span>
</div>
<label for="frm-address">Cập nhật trạng thái:</label> 
<div class="custom-line">
    <span>
        <select name="active" id="change_status">
			<?php echo $getListActive;?>
		</select>
    </span>
</div>

<input type="hidden" value="<?php echo $cid;?>" name="id" />
<input type="hidden" value="<?php echo $data['data']->active;?>" name="old_active" />
<div id="config_campaign" <?php if( $data['data']->active == 2 ){?> <?php }else{ ?>style="display: none;" <?php } ?> >
    <label for="frm-address">Đường dẫn chiến dịch:</label> 
    <input type="text" name="link_campaign" value="<?php echo $data['data']->link_campaign;?>" class="ipt" autocomplete="off" placeholder="Đường dẫn chiến dịch..." />
    <label for="frm-address">Thư mục chứa chiến dịch:</label> 
    <input type="text" name="folder_campaign" value="<?php echo $data['data']->folder_campaign;?>" class="ipt" autocomplete="off" placeholder="Thư mục chứa chiến dịch..." />
    <label for="frm-address">Đường dẫn chuyển hướng chiến dịch:</label> 
    <input type="text" name="link_redirect" value="<?php echo $data['data']->link_redirect;?>" class="ipt" autocomplete="off" placeholder="Đường dẫn chuyển hướng chiến dịch..." />
</div>
                               
                       <div class="lineButton">
                           <button type="submit" class="applyBtn btn btn-small btn-primary"><span>Cập nhật</span></button>
                           <button type="button" onclick="window.location='<?php echo $baseurl.'campaign/dia-diem'?>'" class="cancelBtn btn btn-default btn-small"><span>Hủy bỏ</span></button>
                       </div>
          		  </div>
            </div>
      </div>
 </form>
</div>
        
     </div>
  </div>
</div> 
<style>
body.flash-permanent .contentPanel {
    padding: 100px 0px 18px !important;
}

.tableEsc td{
    padding: 10px 20px;
    border: 1px solid #ccc;
}
.lineHoller{
    background: #fff;
    border-radius: 2px;
    border: 1px solid #e2e2e2;
    box-shadow: none;
    height: 40px;
    line-height: 30px;
    font-size: 14px;
    font-family: "Open Sans", serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    color: #4d4d4d;
    filter: none;
    padding: 4px 6px 4px 12px;
    margin: 0 0 15px 0;
    box-sizing: border-box;
    border-radius: 3px;
}
.lineHoller > span {
    vertical-align: middle;
    display: block;
    height: 100%;
}
.lineButton{
    margin-top: 16px;
}
</style>
<script>
$('#change_status').change(function(){
    var status = $('#change_status').val();
    if( status == 2 ){
        $('#config_campaign').css('display','block');
        setTimeout(function(){
            var height = $('.contentBox').height();
            $('body').scrollTop(height);
        }, 500)
    }else{
        $('#config_campaign').css('display','none');
    }
});
</script>
<script>

$('#frm-time-start').datetimepicker({
dayOfWeekStart : 1,
lang:'vi',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:	'2015/01/01'
});
$('#frm-time-start').datetimepicker({step:15});
$('#frm-time-end').datetimepicker({
dayOfWeekStart : 1,
lang:'vi',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:	'2015/01/01'
});
$('#frm-time-end').datetimepicker({step:15});

</script>